import type { PageParams, HomeGuess } from './../types/global.d'
import type { HomeBannerResult, HomeCategoryItem, HomeGuessItem, HomeHotItem } from '@/types/home'
import { http } from '@/utils/http'

// 首页轮播图
export const getHomeBanner = (distributionSite = 1) => {
  return http<HomeBannerResult[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

// 前台分类
export const getHomeCategoryApi = () => {
  return http<HomeCategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

// 热门推荐
export const getHomeHot = () => {
  return http<HomeHotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

// 猜你喜欢
export const getHomeGoodsGuess = (data?: PageParams) => {
  return http<HomeGuess<HomeGuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
